import Register from '../modules/register.js';
import Login from '../modules/login.js';
import Manage from '../modules/manage.js';
import Student from '../modules/student/student.js';
import Cls from '../modules/class/class.js';
import Course from '../modules/course/course.js';
let routes = {
    '/register':() => new Register(),
    '/login':() => new Login(),
    '/manage':{
        '/student': () => new Student(),
        '/class': () => new Cls(),
        '/course':() => new Course(),
        on:(next) => new Manage(next)
    }
};

// 默认访问登录模块
location.hash = location.hash || "#login";
let router = Router(routes).configure({
    recurse: 'forward',
    async:true,// 需要手动控制后续模块的渲染
    strict:false
}); // 实例化路由
router.init(); // 初始化路由